/**
 * Constructs an HTML string that will be inserted into the content container.
 * 
 * Parses through the RSS entries and creates a "slideshow" representation
 * of the RSS entries. Cycling through stories is done through left/right
 * swipe gestures. The picture (if available), title, and short summary of the
 * article are shown.
 */
function getHorizViewHTML(){

	var maxEntries = 10;
	var nextImg = '<img src="img/nextArrow.png">';
	var prevImg = '<img src="img/prevArrow.png">';
	var outputstr = '';
	var entryIndex = 0;
	
	outputstr += '<div class="horContainer">';
	outputstr += '<span onclick="mwl.switchClass(\'#views\',\'view2\', \'view0\');mwl.removeClass(\'#entries\', \'entry*\');mwl.removeClass(\'#entries\', \'hortransition\');"><img src="img/titlebar.png"></span>';
	outputstr += '<span onclick="mwl.switchClass(\'#views\',\'view2\', \'view1\');mwl.removeClass(\'#entries\', \'entry*\');mwl.removeClass(\'#entries\', \'hortransition\');"><img src="img/back_arrow.png"></span>';
	
	outputstr += '<div id="btns">';
	for (var i = 0; i < entries.length && i < maxEntries; i++)
	{
		if (i == 0)
			outputstr += '<div class="show" id="btn' + i + '">';
		else
			outputstr += '<div class="hide" id="btn' + i + '">';
			
		outputstr += '<table cellpadding="0" cellspacing="0" class="nav">'; 
		outputstr += '<tr>';
		if (i == 0)
		{
			outputstr += '<td>'+prevImg+'</td>';
			outputstr += '<td>';
			outputstr += '<div onclick="mwl.setGroupTarget(\'#btns\',\'#btn1\', \'show\', \'hide\');mwl.switchClass(\'#entries\', \'entry' + i + '\',  \'entry' + (i + 1) + '\');">' + nextImg + '</div>';
			outputstr += '</td>';
		}
		else if ( (i == entries.length - 1) || (i == maxEntries - 1) )
		{
			outputstr += '<td>';					
			outputstr += '<div onclick="mwl.setGroupTarget(\'#btns\',\'#btn' + (i - 1) + '\', \'show\', \'hide\');mwl.switchClass(\'#entries\', \'entry' + i + '\',  \'entry' + (i - 1) + '\');">' + prevImg + '</div>';
			outputstr += '</td>';
			outputstr += '<td>'+nextImg+'</td>';
		}
		else
		{
			outputstr += '<td>';
			outputstr += '<div onclick="mwl.setGroupTarget(\'#btns\',\'#btn' + (i - 1) + '\', \'show\', \'hide\');mwl.switchClass(\'#entries\', \'entry' + i + '\',  \'entry' + (i - 1) + '\');">' + prevImg + '</div>';
			outputstr += '</td>';
			outputstr += '<td>';
			outputstr += '<div onclick="mwl.setGroupTarget(\'#btns\',\'#btn' + (i + 1) + '\', \'show\', \'hide\');mwl.switchClass(\'#entries\', \'entry' + i + '\',  \'entry' + (i + 1) + '\');">' + nextImg + '</div>';
			outputstr += '</td>';
		}
		outputstr += '</tr>';
		outputstr += '</table>';
		
		outputstr += '</div>';
						
	}
	outputstr += '</div>'; // end btns
	
	outputstr += '	<div class="horstrip" id="entries">'; 
	outputstr += '		<table cellspacing="0" cellpadding="0" border="0">'; 
	outputstr += '		<tr>';
		
	for (var i = 0; i < entries.length && i < maxEntries; i++)
	{
		outputstr += '<td valign="top">';
		outputstr += '<div id="entry'+i+'" class="horEntry">';

		outputstr += '<table>';
		outputstr += '<tr>';
		outputstr += '<td valign="top">';
		outputstr += '<span class="headlinePic">';
		outputstr += entries[i].image;
		outputstr += '</span>';
		outputstr += "</td>";
				
		outputstr += "<td>";
		outputstr += '<span class="headline">';
		outputstr += entries[i].title;
		outputstr += '</span>';
		outputstr += "</td>";
		outputstr += "</tr>";
		outputstr += '</table>';
		if (entries[i].pubDate)
		{
			outputstr += '<div class="pubDate">';
			outputstr += entries[i].pubDate;
			outputstr += '</div>';
		}		
		outputstr += '<div class="headlineDesc" id="headlineDesc'+i+'">';
		outputstr += entries[i].summary;
		outputstr += '<br/>';
		outputstr += '<a href="'+entries[i].link+'"><img src="img/readfull.png" /></a>';
		outputstr += '</div>'; // end headlineDesc+i
		outputstr += '</div>'; // end entry
		outputstr += '</td>';	
	}

	outputstr += '	</tr>';
	outputstr += '	</table>'; 
	outputstr += '	</div>'; // end entries
	outputstr += '</div>'; // end container

	return outputstr;
}